/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.dengues.model.warehouse.impl;

import org.dengues.model.warehouse.BlockType;
import org.dengues.model.warehouse.ColumnType;
import org.dengues.model.warehouse.ConnectionType;
import org.dengues.model.warehouse.DocumentRoot;
import org.dengues.model.warehouse.ElementParameterType;
import org.dengues.model.warehouse.MetadataType;
import org.dengues.model.warehouse.NodeType;
import org.dengues.model.warehouse.NoteType;
import org.dengues.model.warehouse.ProcessType;
import org.dengues.model.warehouse.WarehousePackage;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EMap;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl;

import org.eclipse.emf.ecore.util.BasicFeatureMap;
import org.eclipse.emf.ecore.util.EcoreEMap;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Document Root</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getMixed <em>Mixed</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getXMLNSPrefixMap <em>XMLNS Prefix Map</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getXSISchemaLocation <em>XSI Schema Location</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getBlock <em>Block</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getColumn <em>Column</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getConnection <em>Connection</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getElementParameter <em>Element Parameter</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getMetadata <em>Metadata</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getNode <em>Node</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getNote <em>Note</em>}</li>
 *   <li>{@link org.dengues.model.warehouse.impl.DocumentRootImpl#getProcess <em>Process</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DocumentRootImpl extends EObjectImpl implements DocumentRoot {
    /**
     * The cached value of the '{@link #getMixed() <em>Mixed</em>}' attribute list.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getMixed()
     * @generated
     * @ordered
     */
    protected FeatureMap mixed;

    /**
     * The cached value of the '{@link #getXMLNSPrefixMap() <em>XMLNS Prefix Map</em>}' map.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getXMLNSPrefixMap()
     * @generated
     * @ordered
     */
    protected EMap<String, String> xMLNSPrefixMap;

    /**
     * The cached value of the '{@link #getXSISchemaLocation() <em>XSI Schema Location</em>}' map.
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @see #getXSISchemaLocation()
     * @generated
     * @ordered
     */
    protected EMap<String, String> xSISchemaLocation;

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    protected DocumentRootImpl() {
        super();
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    protected EClass eStaticClass() {
        return WarehousePackage.Literals.DOCUMENT_ROOT;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public FeatureMap getMixed() {
        if (mixed == null) {
            mixed = new BasicFeatureMap(this, WarehousePackage.DOCUMENT_ROOT__MIXED);
        }
        return mixed;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public EMap<String, String> getXMLNSPrefixMap() {
        if (xMLNSPrefixMap == null) {
            xMLNSPrefixMap = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, WarehousePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP);
        }
        return xMLNSPrefixMap;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public EMap<String, String> getXSISchemaLocation() {
        if (xSISchemaLocation == null) {
            xSISchemaLocation = new EcoreEMap<String,String>(EcorePackage.Literals.ESTRING_TO_STRING_MAP_ENTRY, EStringToStringMapEntryImpl.class, this, WarehousePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION);
        }
        return xSISchemaLocation;
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public BlockType getBlock() {
        return (BlockType)getMixed().get(WarehousePackage.Literals.DOCUMENT_ROOT__BLOCK, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetBlock(BlockType newBlock, NotificationChain msgs) {
        return ((FeatureMap.Internal)getMixed()).basicAdd(WarehousePackage.Literals.DOCUMENT_ROOT__BLOCK, newBlock, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setBlock(BlockType newBlock) {
        ((FeatureMap.Internal)getMixed()).set(WarehousePackage.Literals.DOCUMENT_ROOT__BLOCK, newBlock);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public ColumnType getColumn() {
        return (ColumnType)getMixed().get(WarehousePackage.Literals.DOCUMENT_ROOT__COLUMN, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetColumn(ColumnType newColumn, NotificationChain msgs) {
        return ((FeatureMap.Internal)getMixed()).basicAdd(WarehousePackage.Literals.DOCUMENT_ROOT__COLUMN, newColumn, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setColumn(ColumnType newColumn) {
        ((FeatureMap.Internal)getMixed()).set(WarehousePackage.Literals.DOCUMENT_ROOT__COLUMN, newColumn);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public ConnectionType getConnection() {
        return (ConnectionType)getMixed().get(WarehousePackage.Literals.DOCUMENT_ROOT__CONNECTION, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetConnection(ConnectionType newConnection, NotificationChain msgs) {
        return ((FeatureMap.Internal)getMixed()).basicAdd(WarehousePackage.Literals.DOCUMENT_ROOT__CONNECTION, newConnection, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setConnection(ConnectionType newConnection) {
        ((FeatureMap.Internal)getMixed()).set(WarehousePackage.Literals.DOCUMENT_ROOT__CONNECTION, newConnection);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public ElementParameterType getElementParameter() {
        return (ElementParameterType)getMixed().get(WarehousePackage.Literals.DOCUMENT_ROOT__ELEMENT_PARAMETER, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetElementParameter(ElementParameterType newElementParameter, NotificationChain msgs) {
        return ((FeatureMap.Internal)getMixed()).basicAdd(WarehousePackage.Literals.DOCUMENT_ROOT__ELEMENT_PARAMETER, newElementParameter, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setElementParameter(ElementParameterType newElementParameter) {
        ((FeatureMap.Internal)getMixed()).set(WarehousePackage.Literals.DOCUMENT_ROOT__ELEMENT_PARAMETER, newElementParameter);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public MetadataType getMetadata() {
        return (MetadataType)getMixed().get(WarehousePackage.Literals.DOCUMENT_ROOT__METADATA, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetMetadata(MetadataType newMetadata, NotificationChain msgs) {
        return ((FeatureMap.Internal)getMixed()).basicAdd(WarehousePackage.Literals.DOCUMENT_ROOT__METADATA, newMetadata, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setMetadata(MetadataType newMetadata) {
        ((FeatureMap.Internal)getMixed()).set(WarehousePackage.Literals.DOCUMENT_ROOT__METADATA, newMetadata);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NodeType getNode() {
        return (NodeType)getMixed().get(WarehousePackage.Literals.DOCUMENT_ROOT__NODE, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetNode(NodeType newNode, NotificationChain msgs) {
        return ((FeatureMap.Internal)getMixed()).basicAdd(WarehousePackage.Literals.DOCUMENT_ROOT__NODE, newNode, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setNode(NodeType newNode) {
        ((FeatureMap.Internal)getMixed()).set(WarehousePackage.Literals.DOCUMENT_ROOT__NODE, newNode);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NoteType getNote() {
        return (NoteType)getMixed().get(WarehousePackage.Literals.DOCUMENT_ROOT__NOTE, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetNote(NoteType newNote, NotificationChain msgs) {
        return ((FeatureMap.Internal)getMixed()).basicAdd(WarehousePackage.Literals.DOCUMENT_ROOT__NOTE, newNote, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setNote(NoteType newNote) {
        ((FeatureMap.Internal)getMixed()).set(WarehousePackage.Literals.DOCUMENT_ROOT__NOTE, newNote);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public ProcessType getProcess() {
        return (ProcessType)getMixed().get(WarehousePackage.Literals.DOCUMENT_ROOT__PROCESS, true);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public NotificationChain basicSetProcess(ProcessType newProcess, NotificationChain msgs) {
        return ((FeatureMap.Internal)getMixed()).basicAdd(WarehousePackage.Literals.DOCUMENT_ROOT__PROCESS, newProcess, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setProcess(ProcessType newProcess) {
        ((FeatureMap.Internal)getMixed()).set(WarehousePackage.Literals.DOCUMENT_ROOT__PROCESS, newProcess);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
        switch (featureID) {
            case WarehousePackage.DOCUMENT_ROOT__MIXED:
                return ((InternalEList<?>)getMixed()).basicRemove(otherEnd, msgs);
            case WarehousePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
                return ((InternalEList<?>)getXMLNSPrefixMap()).basicRemove(otherEnd, msgs);
            case WarehousePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
                return ((InternalEList<?>)getXSISchemaLocation()).basicRemove(otherEnd, msgs);
            case WarehousePackage.DOCUMENT_ROOT__BLOCK:
                return basicSetBlock(null, msgs);
            case WarehousePackage.DOCUMENT_ROOT__COLUMN:
                return basicSetColumn(null, msgs);
            case WarehousePackage.DOCUMENT_ROOT__CONNECTION:
                return basicSetConnection(null, msgs);
            case WarehousePackage.DOCUMENT_ROOT__ELEMENT_PARAMETER:
                return basicSetElementParameter(null, msgs);
            case WarehousePackage.DOCUMENT_ROOT__METADATA:
                return basicSetMetadata(null, msgs);
            case WarehousePackage.DOCUMENT_ROOT__NODE:
                return basicSetNode(null, msgs);
            case WarehousePackage.DOCUMENT_ROOT__NOTE:
                return basicSetNote(null, msgs);
            case WarehousePackage.DOCUMENT_ROOT__PROCESS:
                return basicSetProcess(null, msgs);
        }
        return super.eInverseRemove(otherEnd, featureID, msgs);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public Object eGet(int featureID, boolean resolve, boolean coreType) {
        switch (featureID) {
            case WarehousePackage.DOCUMENT_ROOT__MIXED:
                if (coreType) return getMixed();
                return ((FeatureMap.Internal)getMixed()).getWrapper();
            case WarehousePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
                if (coreType) return getXMLNSPrefixMap();
                else return getXMLNSPrefixMap().map();
            case WarehousePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
                if (coreType) return getXSISchemaLocation();
                else return getXSISchemaLocation().map();
            case WarehousePackage.DOCUMENT_ROOT__BLOCK:
                return getBlock();
            case WarehousePackage.DOCUMENT_ROOT__COLUMN:
                return getColumn();
            case WarehousePackage.DOCUMENT_ROOT__CONNECTION:
                return getConnection();
            case WarehousePackage.DOCUMENT_ROOT__ELEMENT_PARAMETER:
                return getElementParameter();
            case WarehousePackage.DOCUMENT_ROOT__METADATA:
                return getMetadata();
            case WarehousePackage.DOCUMENT_ROOT__NODE:
                return getNode();
            case WarehousePackage.DOCUMENT_ROOT__NOTE:
                return getNote();
            case WarehousePackage.DOCUMENT_ROOT__PROCESS:
                return getProcess();
        }
        return super.eGet(featureID, resolve, coreType);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eSet(int featureID, Object newValue) {
        switch (featureID) {
            case WarehousePackage.DOCUMENT_ROOT__MIXED:
                ((FeatureMap.Internal)getMixed()).set(newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
                ((EStructuralFeature.Setting)getXMLNSPrefixMap()).set(newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
                ((EStructuralFeature.Setting)getXSISchemaLocation()).set(newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__BLOCK:
                setBlock((BlockType)newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__COLUMN:
                setColumn((ColumnType)newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__CONNECTION:
                setConnection((ConnectionType)newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__ELEMENT_PARAMETER:
                setElementParameter((ElementParameterType)newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__METADATA:
                setMetadata((MetadataType)newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__NODE:
                setNode((NodeType)newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__NOTE:
                setNote((NoteType)newValue);
                return;
            case WarehousePackage.DOCUMENT_ROOT__PROCESS:
                setProcess((ProcessType)newValue);
                return;
        }
        super.eSet(featureID, newValue);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public void eUnset(int featureID) {
        switch (featureID) {
            case WarehousePackage.DOCUMENT_ROOT__MIXED:
                getMixed().clear();
                return;
            case WarehousePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
                getXMLNSPrefixMap().clear();
                return;
            case WarehousePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
                getXSISchemaLocation().clear();
                return;
            case WarehousePackage.DOCUMENT_ROOT__BLOCK:
                setBlock((BlockType)null);
                return;
            case WarehousePackage.DOCUMENT_ROOT__COLUMN:
                setColumn((ColumnType)null);
                return;
            case WarehousePackage.DOCUMENT_ROOT__CONNECTION:
                setConnection((ConnectionType)null);
                return;
            case WarehousePackage.DOCUMENT_ROOT__ELEMENT_PARAMETER:
                setElementParameter((ElementParameterType)null);
                return;
            case WarehousePackage.DOCUMENT_ROOT__METADATA:
                setMetadata((MetadataType)null);
                return;
            case WarehousePackage.DOCUMENT_ROOT__NODE:
                setNode((NodeType)null);
                return;
            case WarehousePackage.DOCUMENT_ROOT__NOTE:
                setNote((NoteType)null);
                return;
            case WarehousePackage.DOCUMENT_ROOT__PROCESS:
                setProcess((ProcessType)null);
                return;
        }
        super.eUnset(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public boolean eIsSet(int featureID) {
        switch (featureID) {
            case WarehousePackage.DOCUMENT_ROOT__MIXED:
                return mixed != null && !mixed.isEmpty();
            case WarehousePackage.DOCUMENT_ROOT__XMLNS_PREFIX_MAP:
                return xMLNSPrefixMap != null && !xMLNSPrefixMap.isEmpty();
            case WarehousePackage.DOCUMENT_ROOT__XSI_SCHEMA_LOCATION:
                return xSISchemaLocation != null && !xSISchemaLocation.isEmpty();
            case WarehousePackage.DOCUMENT_ROOT__BLOCK:
                return getBlock() != null;
            case WarehousePackage.DOCUMENT_ROOT__COLUMN:
                return getColumn() != null;
            case WarehousePackage.DOCUMENT_ROOT__CONNECTION:
                return getConnection() != null;
            case WarehousePackage.DOCUMENT_ROOT__ELEMENT_PARAMETER:
                return getElementParameter() != null;
            case WarehousePackage.DOCUMENT_ROOT__METADATA:
                return getMetadata() != null;
            case WarehousePackage.DOCUMENT_ROOT__NODE:
                return getNode() != null;
            case WarehousePackage.DOCUMENT_ROOT__NOTE:
                return getNote() != null;
            case WarehousePackage.DOCUMENT_ROOT__PROCESS:
                return getProcess() != null;
        }
        return super.eIsSet(featureID);
    }

    /**
     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    @Override
    public String toString() {
        if (eIsProxy()) return super.toString();

        StringBuffer result = new StringBuffer(super.toString());
        result.append(" (mixed: ");
        result.append(mixed);
        result.append(')');
        return result.toString();
    }

} //DocumentRootImpl
